package com.fiberhome.student;

import java.util.Locale;

public class Student {
	private String name;
	private String number;
	private Integer chinese;
	private Integer mathematics;
	private Integer english;


	public Student(String name, String number, Integer chinese, Integer mathematics, Integer english) {
		super();
		this.name = name;
		this.number = number;
		this.chinese = chinese;
		this.mathematics = mathematics;
		this.english = english;
	}

	/**
	 * 求总分
	 * 
	 * @return
	 */
	public Integer getTotal() {
		Integer total = 0;
		if (this.chinese != null) {
			total += chinese;
		}
		if (this.mathematics != null) {
			total += mathematics;
		}
		if (this.english != null) {
			total += english;
		}
		return total;
	}

	
	
	@Override
	public String toString() {
		return String.format(Locale.CHINESE,"%s\t%s\t%s\t%s\t%s\t%s", name,number,chinese,mathematics,english, getTotal());
	}

	public Integer getChinese() {
		return chinese;
	}

	public void setChinese(Integer chinese) {
		this.chinese = chinese;
	}

	public Integer getMathematics() {
		return mathematics;
	}

	public void setMathematics(Integer mathematics) {
		this.mathematics = mathematics;
	}

	public Integer getEnglish() {
		return english;
	}

	public void setEnglish(Integer english) {
		this.english = english;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

}
